import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

/* Layout */
import Layout from '@/layout'
import { getHospitalId } from '@/utils/auth'

/* Router Modules */
import componentsRouter from './modules/components'
import chartsRouter from './modules/charts'
import tableRouter from './modules/table'
import nestedRouter from './modules/nested'
import templateRouter from './modules/template'
/**
 * Note: sub-menu only appear when route children.length >= 1
 * Detail see: https://panjiachen.github.io/vue-element-admin-site/guide/essentials/router-and-nav.html
 *
 * hidden: true                   if set true, item will not show in the sidebar(default is false)
 * alwaysShow: true               if set true, will always show the root menu
 *                                if not set alwaysShow, when item has more than one children route,
 *                                it will becomes nested mode, otherwise not show the root menu
 * redirect: noRedirect           if set noRedirect will no redirect in the breadcrumb
 * name:'router-name'             the name is used by <keep-alive> (must set!!!)
 * meta : {
    roles: ['admin','editor']    control the page roles (you can set multiple roles)
    title: 'title'               the name show in sidebar and breadcrumb (recommend set)
    icon: 'svg-name'             the icon show in the sidebar
    noCache: true                if set true, the page will no be cached(default is false)
    affix: true                  if set true, the tag will affix in the tags-view
    breadcrumb: false            if set false, the item will hidden in breadcrumb(default is true)
    activeMenu: '/example/list'  if set path, the sidebar will highlight the path you set
  }
 */

/**
 * constantRoutes
 * a base page that does not have permission requirements
 * all roles can be accessed
 */
export const constantRoutes = [{
  path: '/redirect',
  component: Layout,
  hidden: true,
  children: [{
    path: '/redirect/:path*',
    component: () => import('@/views/redirect/index')
  }]
},
{
  path: '/login',
  component: () => import('@/views/login/index'),
  hidden: true
},
{
  path: '/auth-redirect',
  component: () => import('@/views/login/auth-redirect'),
  hidden: true
},
{
  path: '/404',
  component: () => import('@/views/error-page/404'),
  hidden: true
},
{
  path: '/401',
  component: () => import('@/views/error-page/401'),
  hidden: true
},
{
  path: '/notice',
  component: Layout,
  name: 'notice',
  hidden: true,
  meta: {
    title: '通知',
    icon: 'message'
  },
  alwaysShow: true,
  redirect: '/notice/notice-page',
  children: [{
    path: 'notice-page',
    component: () => import('@/views/notice/notice-page'),
    name: 'notice-page',
    meta: {
      title: '通知'
    }
  }

  ]
}
]

/**
 * asyncRoutes
 * the routes that need to be dynamically loaded based on user roles
 */
export const asyncTraumaRoutes = [

  /* 筛查-筛查详情未绑值*/
  // {
  //   path: '/screening',
  //   component: Layout,
  //   alwaysShow: true,
  //   name: 'screening',
  //   meta: {
  //     title: '筛查列表',
  //     icon: 'zip'
  //   },
  //   redirect: '/screening/screening-list',
  //   children: [{
  //     path: '/screening/screening-list',
  //     component: () => import('@/views/screening/screening-list'),
  //     name: 'screeningList',
  //     meta: {
  //       title: '筛查列表'
  //     }
  //   },
  //   {
  //     path: '/screening/screening-details',
  //     component: () => import('@/views/screening/screening-details'),
  //     name: 'screeningDetails',
  //     hidden: true,
  //     meta: {
  //       title: '筛查详情',
  //       activeMenu: '/screening/screening-list'
  //     }
  //   }
  //   ]
  // },
  // {
  //   path: '/dashboard',
  //   component: Layout,
  //   redirect: '/dashboard/dashboard',
  //   name: 'dashboard',
  //   meta: {
  //     title: '实时监控',
  //     icon: 'form'
  //   },
  //   children: [{
  //     path: 'dashboard',
  //     component: () => import('@/views/dashboard/dashboard'),
  //     name: 'realTime',
  //     meta: {
  //       title: '实时监控',
  //       icon: 'dashboard',
  //       affix: false
  //     }
  //   }]
  // },
  {
    path: '/comprehensive',
    component: Layout,
    redirect: '/comprehensive/comprehensive',
    name: 'comprehensive',
    meta: {
      title: '综合展示',
      icon: 'form'
    },
    children: [{
      path: '/comprehensive',
      component: () => import('@/views/comprehensive/comprehensive'),
      name: 'comprehensive',
      meta: {
        title: '综合展示',
        icon: 'dashboard',
        affix: false
      }
    }]
  },
  // 首页
  // 1
  // screen/scanboard
  // 1
  // 筛查列表
  // 2
  // screening
  // 2
  // 分诊列表
  // 7
  // triage
  // 3
  // 绿色通道
  // 3
  // patient
  // 4
  // 随访记录
  // 4
  // followupchest
  // 5
  // 统计分析
  // 5
  // quality
  // 6
  // 后台管理
  // 6
  // backmanagement

  /* 分诊 */
  // {
  //   path: '/triage',
  //   component: Layout,
  //   // alwaysShow: true,
  //   name: 'triage',
  //   meta: {
  //     title: '分诊列表',
  //     icon: 'tree'
  //   },
  //   redirect: '/triage/triage-list',
  //   children: [
  //     {
  //       path: '/triage/triage-list',
  //       component: () => import('@/views/triage/triage-list'),
  //       name: 'triageList',
  //       meta: { title: '分诊列表' }
  //     },
  //     {
  //       path: '/triage/triage-new',
  //       component: () => import('@/views/triage/triage-new'),
  //       name: 'TriageNew',
  //       hidden: true,
  //       meta: {
  //         title: '新增分诊'
  //       }
  //     },
  //     {
  //       path: '/triage/injury-group',
  //       component: () => import('@/views/triage/injury-group'),
  //       name: 'InjuryGroup',
  //       hidden: true,
  //       meta: {
  //         title: '群伤管理'
  //       }
  //     }

  //   ]
  // },
  // 绿道
  {
    path: '/',
    // path: '/green-channel',
    component: Layout,
    // alwaysShow: true,
    name: 'patient',
    meta: {
      title: '绿色通道',
      icon: 'form'
    },
    redirect: '/green-channel/patients-list',
    children: [
      {
        path: '/green-channel/patients-list',
        component: () => import('@/views/green-channel/patients-list'),
        name: 'patientsList',
        meta: {
          title: '绿色通道'
        }
      },
      {
        path: '/green-channel/infoStrokeNew',
        component: () => import('@/views/green-channel/infoStrokeNew'),
        name: 'InfoStrokeNew',
        hidden: true,
        meta: {
          title: '卒中患者新增'
        }
      }
    ]
  },

  /* 随访 - */
  // {
  //   path: '/follow-up',
  //   component: Layout,
  //   // alwaysShow: true,
  //   name: 'followUp',
  //   meta: {
  //     title: '随访记录',
  //     icon: 'guide'
  //   },
  //   redirect: '/follow-up/follow-up-records',
  //   children: [{
  //     path: '/follow-up/follow-up-records',
  //     component: () => import('@/views/follow-up/follow-up-records'),
  //     name: 'followUpRecords',
  //     meta: {
  //       title: '随访记录'
  //     }
  //   },
  //   {
  //     path: '/follow-up/follow-up-new',
  //     component: () => import('@/views/follow-up/follow-up-new'),
  //     name: 'followUpNew',
  //     hidden: true,
  //     meta: {
  //       title: '新增随访'
  //     }
  //   },
  //   {
  //     path: '/follow-up/follow-up-details',
  //     component: () => import('@/views/follow-up/follow-up-details'),
  //     name: 'followUpDetails',
  //     hidden: true,
  //     meta: {
  //       title: '患者详情'
  //     }
  //   },
  //   {
  //     path: '/follow-up/thepicture',
  //     component: () => import('@/views/follow-up/thepicture'),
  //     name: 'thepicture',
  //     hidden: true,
  //     meta: {
  //       title: '患者详情图片'
  //     }
  //   }
  //   ]
  // },

  /* 随访列表 */
  {
    path: '/follow-up-list',
    component: Layout,
    alwaysShow: true,
    name: 'followUpList',
    meta: {
      title: '随访记录',
      icon: 'chart',
    },
    redirect: '/follow-up-list/chest-pain',
    children: [
      {
        path: '/follow-up-list/chest-pain',
        component: () => import('@/views/follow-up-list/chest-pain'),
        name: 'followUpListChestPain',
        meta: {
          title: '胸痛随访列表',
          noCache: true
        }
      },
      {
        path: '/follow-up-list/follow-up-details',
        component: () => import('@/views/follow-up-list/chest-pain/follow-up-details'),
        name: 'followUpListDetails',
        hidden: true,
        meta: {
          title: '随访详情'
        }
      }
    ]
  },

  // 定位信标管理
  {
    path: '/beaconapplication',
    component: Layout,
    name: 'patient',
    meta: {
      title: '信标应用',
      icon: 'star',
    },
    redirect: '/beacon/application',
    children: [
      {
        path: '/beacon/application',
        name: 'BeaconApplication',
        meta: {
          title: '信标应用',
        },
        component: () => import('@/views/beacon/beacon-application'),
      },
    ]
  },
  {
    path: '/beaconmanagement',
    component: Layout,
    name: 'patient',
    meta: {
      title: '信标管理',
      icon: 'print',
    },
    redirect: '/beacon/management',
    children: [
      {
        path: '/beacon/management',
        name: 'BeaconManagement',
        meta: {
          title: '信标管理',
        },
        component: () => import('@/views/beacon/beacon-management'),
      },
    ]
  },

  /* 统计分析 */
  {
    path: '/statistical',
    component: Layout,
    // alwaysShow: true,
    name: 'statistical',
    meta: {
      title: '统计分析',
      icon: 'chart'
    },
    redirect: '/statistical/chestPain-quality',
    children: (getHospitalId() == 76 || getHospitalId() == '201') ? [{
      path: '/statistical/chestPainStore-quality',
      component: () => import('@/views/statistical/chestPainStore-quality'),
      name: 'chestPainStoreQuality',
      meta: {
        title: '卒中质控统计'
      }
    }, {
      path: '/statistical/stroke-report',
      component: () => import('@/views/statistical/stroke-report'),
      name: 'strokeReport',
      meta: {
        title: '卒中数据统计'
      }
    }] : [{
      path: '/statistical/chestPain-quality',
      component: () => import('@/views/statistical/chestPain-quality'),
      name: 'chestPainQuality',
      meta: {
        title: '胸痛质控统计'
      }
    }, {
      path: '/statistical/chestPainStore-quality',
      component: () => import('@/views/statistical/chestPainStore-quality'),
      name: 'chestPainStoreQuality',
      meta: {
        title: '卒中质控统计'
      }
    }, {
      path: '/statistical/chestPain-report',
      component: () => import('@/views/statistical/chestPain-report'),
      name: 'chestPainReport',
      meta: {
        title: '胸痛上报统计'
      }
    }, {
      path: '/statistical/stroke-report',
      component: () => import('@/views/statistical/stroke-report'),
      name: 'strokeReport',
      meta: {
        title: '卒中数据统计'
      }
    }, {
      path: '/statistical/trauma-quality',
      component: () => import('@/views/statistical/trauma-quality'),
      name: 'traumaQuality',
      meta: {
        title: '创伤质控统计'
      }
    }]
  },

  /* 后台管理 */
  {
    path: '/back-management',
    component: Layout,
    alwaysShow: true,
    name: 'backManagement',
    meta: {
      title: '后台管理',
      icon: 'component',
      roles: ['SUPER_ADMIN', 'LITTLE_ADMIN']
    },
    redirect: '/back-management/BG_mechanism',
    children: [
      {
        path: '/back-management/greenway-set',
        component: () => import('@/views/back-management/greenway-set/greenway-set'),
        name: 'greenwaySet',
        meta: {
          title: '绿道设置'
        }
      },
      // {
      //   path: '/back-management/statistical-set/statisticalSet',
      //   component: () => import('@/views/back-management/statistical-set/statisticalSet'),
      //   name: 'statisticalSet',
      //   meta: {
      //     title: '统计设置'
      //   }
      // },
      {
        path: '/back-management/account-set',
        component: () => import('@/views/back-management/account-set/account-set'),
        name: 'accountSet',
        meta: {
          title: '账户设置'
        }
      },
      // {
      //   path: '/back-management/account-set/BG_menu',
      //   component: () => import('@/views/back-management/account-set/BG_menu'),
      //   name: 'BG_menu',
      //   meta: {
      //     title: '菜单设置'
      //   }
      // },
      // {
      //   path: '/back-management/follow_up_set',
      //   component: () => import('@/views/back-management/follow_up_set'),
      //   name: 'follow_up_set',
      //   meta: {
      //     title: '随访设置'
      //   }
      // },
      // {
      //   path: '/back-management/the_new_questionnaire',
      //   component: () => import('@/views/back-management/the_new_questionnaire'),
      //   name: 'the_new_questionnaire',
      //   hidden: true,
      //   meta: {
      //     title: '新增问卷'
      //   }
      // },
      // {
      //   path: '/back-management/the_new_questionnaire_details',
      //   component: () => import('@/views/back-management/the_new_questionnaire_details'),
      //   name: 'the_new_questionnaire_details',
      //   hidden: true,
      //   meta: {
      //     title: '修改问卷'
      //   }
      // },
      // {
      //   path: '/back-management/new_patient_education',
      //   component: () => import('@/views/back-management/new_patient_education'),
      //   name: 'new_patient_education',
      //   hidden: true,
      //   meta: {
      //     title: '新增患者教育'
      //   }
      // },
      // {
      //   path: '/back-management/details_patient_education',
      //   component: () => import('@/views/back-management/details_patient_education'),
      //   name: 'details_patient_education',
      //   hidden: true,
      //   meta: {
      //     title: '患者教育详情'
      //   }

      // },
      // {
      //   path: '/back-management/editor_patient_education',
      //   component: () => import('@/views/back-management/editor_patient_education'),
      //   name: 'editor_patient_education',
      //   hidden: true,
      //   meta: {
      //     title: '修改患者教育'
      //   }

      // },
      {
        path: '/follow-up/follow-up-information-details',
        component: () => import('@/views/follow-up/follow-up-information-details'),
        name: 'follow-up-information-details',
        hidden: true,
        meta: {
          title: '随访信息详情'
        }
      },
      {
        path: '/follow-up/follow-up-information-details_blank',
        component: () => import('@/views/follow-up/follow-up-information-details_blank'),
        name: 'follow-up-information-details_blank',
        hidden: true,
        meta: {
          title: '新增随访信息表单'
        }
      },
      // {
      //   path: '/back-management/Association_configuration_form_update',
      //   component: () => import('@/views/back-management/Association_configuration_form_update'),
      //   name: 'Association_configuration_form_update',
      //   hidden: true,
      //   meta: {
      //     title: '关键配置修改问卷'
      //   }
      // },
      // {
      //   path: '/back-management/Association_configuration_form',
      //   component: () => import('@/views/back-management/Association_configuration_form'),
      //   name: 'Association_configuration_form',
      //   hidden: true,
      //   meta: {
      //     title: '关联配置新增问卷'
      //   }
      // },
      // {
      //   path: '/follow-up/follow-up-information-editor',
      //   component: () => import('@/views/follow-up/follow-up-information-editor'),
      //   name: 'follow-up-information-editor',
      //   hidden: true,
      //   meta: {
      //     title: '修改随访信息表单'
      //   }
      // },

      // {
      //   path: '/back-management/triage-set',
      //   component: () => import('@/views/back-management/triage-set/triage-set'),
      //   name: 'TriageSet',
      //   meta: {
      //     title: '分诊设置'
      //   }
      // }

    ]
  }

  /** when your routing map is too long, you can split it into small modules **/
  // componentsRouter,
  // chartsRouter,
  // nestedRouter,
  // tableRouter,
  // ...templateRouter,

  // 404 page must be placed at the end !!!
  // {
  //   path: '*',
  //   redirect: '/404',
  //   hidden: true
  // }
]
export const asyncRoutes = [

  /* 筛查-筛查详情未绑值*/
  // {
  //   path: '/screening',
  //   component: Layout,
  //   alwaysShow: true,
  //   name: 'screening',
  //   meta: {
  //     title: '筛查列表',
  //     icon: 'zip'
  //   },
  //   redirect: '/screening/screening-list',
  //   children: [{
  //     path: '/screening/screening-list',
  //     component: () => import('@/views/screening/screening-list'),
  //     name: 'screeningList',
  //     meta: {
  //       title: '筛查列表'
  //     }
  //   },
  //   {
  //     path: '/screening/screening-details',
  //     component: () => import('@/views/screening/screening-details'),
  //     name: 'screeningDetails',
  //     hidden: true,
  //     meta: {
  //       title: '筛查详情',
  //       activeMenu: '/screening/screening-list'
  //     }
  //   }
  //   ]
  // },
  // {
  //   path: '/dashboard',
  //   component: Layout,
  //   redirect: '/dashboard/dashboard',
  //   name: 'dashboard',
  //   meta: {
  //     title: '实时监控',
  //     icon: 'form'
  //   },
  //   children: [{
  //     path: 'dashboard',
  //     component: () => import('@/views/dashboard/dashboard'),
  //     name: 'realTime',
  //     meta: {
  //       title: '实时监控',
  //       icon: 'dashboard',
  //       affix: false
  //     }
  //   }]
  // },
  {
    path: '/comprehensive',
    component: Layout,
    redirect: '/comprehensive/comprehensive',
    name: 'comprehensive',
    meta: {
      title: '综合展示',
      icon: 'form'
    },
    children: [{
      path: '/comprehensive',
      component: () => import('@/views/comprehensive/comprehensive'),
      name: 'comprehensive',
      meta: {
        title: '综合展示',
        icon: 'dashboard',
        affix: false
      }
    }]
  },
  // 首页
  // 1
  // screen/scanboard
  // 1
  // 筛查列表
  // 2
  // screening
  // 2
  // 分诊列表
  // 7
  // triage
  // 3
  // 绿色通道
  // 3
  // patient
  // 4
  // 随访记录
  // 4
  // followupchest
  // 5
  // 统计分析
  // 5
  // quality
  // 6
  // 后台管理
  // 6
  // backmanagement

  /* 分诊 */
  // {
  //   path: '/triage',
  //   component: Layout,
  //   // alwaysShow: true,
  //   name: 'triage',
  //   meta: {
  //     title: '分诊列表',
  //     icon: 'tree'
  //   },
  //   redirect: '/triage/triage-list',
  //   children: [
  //     {
  //       path: '/triage/triage-list',
  //       component: () => import('@/views/triage/triage-list'),
  //       name: 'triageList',
  //       meta: { title: '分诊列表' }
  //     },
  //     {
  //       path: '/triage/triage-new',
  //       component: () => import('@/views/triage/triage-new'),
  //       name: 'TriageNew',
  //       hidden: true,
  //       meta: {
  //         title: '新增分诊'
  //       }
  //     },
  //     {
  //       path: '/triage/injury-group',
  //       component: () => import('@/views/triage/injury-group'),
  //       name: 'InjuryGroup',
  //       hidden: true,
  //       meta: {
  //         title: '群伤管理'
  //       }
  //     }

  //   ]
  // },
  // 绿道
  {
    path: '/',
    // path: '/green-channel',
    component: Layout,
    // alwaysShow: true,
    name: 'patient',
    meta: {
      title: '绿色通道',
      icon: 'form'
    },
    redirect: '/green-channel/patients-list',
    children: [
      {
        path: '/green-channel/patients-list',
        component: () => import('@/views/green-channel/patients-list'),
        name: 'patientsList',
        meta: {
          title: '绿色通道'
        }
      },
      {
        path: '/green-channel/infoStrokeNew',
        component: () => import('@/views/green-channel/infoStrokeNew'),
        name: 'InfoStrokeNew',
        hidden: true,
        meta: {
          title: '卒中患者新增'
        }
      }
    ]
  },

  /* 随访列表 */
  {
    path: '/follow-up-list',
    component: Layout,
    alwaysShow: true,
    name: 'followUpList',
    meta: {
      title: '随访记录',
      icon: 'chart'
    },
    redirect: '/follow-up-list/chest-pain',
    children: [
      {
        path: '/follow-up-list/chest-pain',
        component: () => import('@/views/follow-up-list/chest-pain'),
        name: 'followUpListChestPain',
        meta: {
          title: '胸痛随访列表'
        }
      },
      // {
      //   path: '/follow-up/follow-up-records',
      //   component: () => import('@/views/follow-up/follow-up-records'),
      //   name: 'followUpRecords',
      //   meta: {
      //     title: '随访记录'
      //   }
      // },
      // {
      //   path: '/follow-up/follow-up-new',
      //   component: () => import('@/views/follow-up/follow-up-new'),
      //   name: 'followUpNew',
      //   hidden: true,
      //   meta: {
      //     title: '新增随访'
      //   }
      // },
      {
        path: '/follow-up-list/follow-up-details',
        component: () => import('@/views/follow-up-list/chest-pain/follow-up-details'),
        name: 'followUpListDetails',
        hidden: true,
        meta: {
          title: '随访详情'
        }
      }
    ]
  },

  // 定位信标管理
  {
    path: '/',
    component: Layout,
    redirect: '/beacon/application',
    name: 'patient',
    children: [{
      path: '/beacon/application',
      component: () => import('@/views/beacon/beacon-application'),
      name: 'BeaconApplication',
      meta: {
        title: '信标应用',
        icon: 'guide',
        affix: false
      }
    }]
  },

  /* 随访 - */
  // {
  //   path: '/follow-up',
  //   component: Layout,
  //   // alwaysShow: true,
  //   name: 'followUp',
  //   meta: {
  //     title: '随访记录',
  //     icon: 'guide'
  //   },
  //   redirect: '/follow-up/follow-up-records',
  //   children: [
  // {
  //     path: '/follow-up/follow-up-records',
  //     component: () => import('@/views/follow-up/follow-up-records'),
  //     name: 'followUpRecords',
  //     meta: {
  //       title: '随访记录'
  //     }
  //   },
  //   {
  //     path: '/follow-up/follow-up-new',
  //     component: () => import('@/views/follow-up/follow-up-new'),
  //     name: 'followUpNew',
  //     hidden: true,
  //     meta: {
  //       title: '新增随访'
  //     }
  //   },
  //   {
  //     path: '/follow-up/follow-up-details',
  //     component: () => import('@/views/follow-up/follow-up-details'),
  //     name: 'followUpDetails',
  //     hidden: true,
  //     meta: {
  //       title: '患者详情'
  //     }
  //   },
  //   {
  //     path: '/follow-up/thepicture',
  //     component: () => import('@/views/follow-up/thepicture'),
  //     name: 'thepicture',
  //     hidden: true,
  //     meta: {
  //       title: '患者详情图片'
  //     }
  //   }
  //   ]
  // },

  /* 统计分析 */
  {
    path: '/statistical',
    component: Layout,
    // alwaysShow: true,
    name: 'statistical',
    meta: {
      title: '统计分析',
      icon: 'chart'
    },
    redirect: '/statistical/chestPain-quality',
    children: (getHospitalId() == 76 || getHospitalId() == 201) ? [{
      path: '/statistical/chestPainStore-quality',
      component: () => import('@/views/statistical/chestPainStore-quality'),
      name: 'chestPainStoreQuality',
      meta: {
        title: '卒中质控统计'
      }
    }, {
      path: '/statistical/stroke-report',
      component: () => import('@/views/statistical/stroke-report'),
      name: 'strokeReport',
      meta: {
        title: '卒中数据统计'
      }
    }] : [{
      path: '/statistical/chestPain-quality',
      component: () => import('@/views/statistical/chestPain-quality'),
      name: 'chestPainQuality',
      meta: {
        title: '胸痛质控统计'
      }
    }, {
      path: '/statistical/chestPainStore-quality',
      component: () => import('@/views/statistical/chestPainStore-quality'),
      name: 'chestPainStoreQuality',
      meta: {
        title: '卒中质控统计'
      }
    }, {
      path: '/statistical/chestPain-report',
      component: () => import('@/views/statistical/chestPain-report'),
      name: 'chestPainReport',
      meta: {
        title: '胸痛上报统计'
      }
    }, {
      path: '/statistical/stroke-report',
      component: () => import('@/views/statistical/stroke-report'),
      name: 'strokeReport',
      meta: {
        title: '卒中数据统计'
      }
    }]
  },
  /* 后台管理 */
  {
    path: '/back-management',
    component: Layout,
    alwaysShow: true,
    name: 'backManagement',
    meta: {
      title: '后台管理',
      icon: 'component',
      roles: ['SUPER_ADMIN', 'LITTLE_ADMIN']
    },
    redirect: '/back-management/BG_mechanism',
    children: [
      {
        path: '/back-management/greenway-set',
        component: () => import('@/views/back-management/greenway-set/greenway-set'),
        name: 'greenwaySet',
        meta: {
          title: '绿道设置'
        }
      },
      // {
      //   path: '/back-management/statistical-set/statisticalSet',
      //   component: () => import('@/views/back-management/statistical-set/statisticalSet'),
      //   name: 'statisticalSet',
      //   meta: {
      //     title: '统计设置'
      //   }
      // },
      {
        path: '/back-management/account-set',
        component: () => import('@/views/back-management/account-set/account-set'),
        name: 'accountSet',
        meta: {
          title: '账户设置'
        }
      }
      // {
      //   path: '/back-management/account-set/BG_menu',
      //   component: () => import('@/views/back-management/account-set/BG_menu'),
      //   name: 'BG_menu',
      //   meta: {
      //     title: '菜单设置'
      //   }
      // },
      // {
      //   path: '/back-management/follow_up_set',
      //   component: () => import('@/views/back-management/follow_up_set'),
      //   name: 'follow_up_set',
      //   meta: {
      //     title: '随访设置'
      //   }
      // },
      // {
      //   path: '/back-management/the_new_questionnaire',
      //   component: () => import('@/views/back-management/the_new_questionnaire'),
      //   name: 'the_new_questionnaire',
      //   hidden: true,
      //   meta: {
      //     title: '新增问卷'
      //   }
      // },
      // {
      //   path: '/back-management/the_new_questionnaire_details',
      //   component: () => import('@/views/back-management/the_new_questionnaire_details'),
      //   name: 'the_new_questionnaire_details',
      //   hidden: true,
      //   meta: {
      //     title: '修改问卷'
      //   }
      // },
      // {
      //   path: '/back-management/new_patient_education',
      //   component: () => import('@/views/back-management/new_patient_education'),
      //   name: 'new_patient_education',
      //   hidden: true,
      //   meta: {
      //     title: '新增患者教育'
      //   }
      // },
      // {
      //   path: '/back-management/details_patient_education',
      //   component: () => import('@/views/back-management/details_patient_education'),
      //   name: 'details_patient_education',
      //   hidden: true,
      //   meta: {
      //     title: '患者教育详情'
      //   }

      // },
      // {
      //   path: '/back-management/editor_patient_education',
      //   component: () => import('@/views/back-management/editor_patient_education'),
      //   name: 'editor_patient_education',
      //   hidden: true,
      //   meta: {
      //     title: '修改患者教育'
      //   }

      // },
      // {
      //   path: '/follow-up/follow-up-information-details',
      //   component: () => import('@/views/follow-up/follow-up-information-details'),
      //   name: 'follow-up-information-details',
      //   hidden: true,
      //   meta: {
      //     title: '随访信息详情'
      //   }
      // },
      // {
      //   path: '/follow-up/follow-up-information-details_blank',
      //   component: () => import('@/views/follow-up/follow-up-information-details_blank'),
      //   name: 'follow-up-information-details_blank',
      //   hidden: true,
      //   meta: {
      //     title: '新增随访信息表单'
      //   }
      // },
      // {
      //   path: '/back-management/Association_configuration_form_update',
      //   component: () => import('@/views/back-management/Association_configuration_form_update'),
      //   name: 'Association_configuration_form_update',
      //   hidden: true,
      //   meta: {
      //     title: '关键配置修改问卷'
      //   }
      // },
      // {
      //   path: '/back-management/Association_configuration_form',
      //   component: () => import('@/views/back-management/Association_configuration_form'),
      //   name: 'Association_configuration_form',
      //   hidden: true,
      //   meta: {
      //     title: '关联配置新增问卷'
      //   }
      // },
      // {
      //   path: '/follow-up/follow-up-information-editor',
      //   component: () => import('@/views/follow-up/follow-up-information-editor'),
      //   name: 'follow-up-information-editor',
      //   hidden: true,
      //   meta: {
      //     title: '修改随访信息表单'
      //   }
      // },

      // {
      //   path: '/back-management/triage-set',
      //   component: () => import('@/views/back-management/triage-set/triage-set'),
      //   name: 'TriageSet',
      //   meta: {
      //     title: '分诊设置'
      //   }
      // }

    ]
  }

  /** when your routing map is too long, you can split it into small modules **/
  // componentsRouter,
  // chartsRouter,
  // nestedRouter,
  // tableRouter,
  // ...templateRouter,

  // 404 page must be placed at the end !!!
  // {
  //   path: '*',
  //   redirect: '/404',
  //   hidden: true
  // }
]
export const notFoundRoutes = [{
  path: '*',
  redirect: '/404',
  hidden: true
}
]
const createRouter = () => new Router({
  // mode: 'history', // require service support
  scrollBehavior: () => ({
    y: 0
  }),
  routes: constantRoutes
})

const router = createRouter()

// Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465
export function resetRouter() {
  const newRouter = createRouter()
  router.matcher = newRouter.matcher // reset router
}

export default router
